package com.whw.fy.service.impl;

import com.whw.fy.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.whw.fy.entity.Academic;
import com.whw.fy.mapper.AcademicMapper;
import com.whw.fy.service.AcademicService;

@Service
public class AcademicServiceImpl implements AcademicService {

    @Resource
    private AcademicMapper academicMapper;

    @Override
    public Message deleteByPrimaryKey(Integer academicId) {
        return academicMapper.deleteByPrimaryKey(academicId) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insert(Academic record) {
        return academicMapper.insert(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insertSelective(Academic record) {
        return academicMapper.insertSelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer academicId) {
        return Message.success(null).add(academicMapper.selectByPrimaryKey(academicId));
    }

    @Override
    public Message updateByPrimaryKeySelective(Academic record) {
        return academicMapper.updateByPrimaryKeySelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(Academic record) {
        return Message.success(null).add(academicMapper.updateByPrimaryKey(record));
    }

    @Override
    public Message selectAll() {
        return Message.success(null).add(academicMapper.selectAll());
    }

    @Override
    public Message selectAllByAcademicType(Integer academicType) {
        return Message.success(null).add(academicMapper.selectAllByAcademicType(academicType));
    }

}



